<html>
<head>
	<meta charset="utf-8">
	<title></title>
	
	<script type="text/javascript">
	function Student(id,name,sex,age,score){
		this.id = id;
		this.name = name;
		this.sex = sex;
		this.age = age;
		this.score = score;
		this.input = function(){
			return "id:"+this.id+","+"name:"+this.name+","+"sex:"+this.sex+","+"age:"+this.age+","+"score:"+this.score+"\n";
		}
	}


	var studentArr=new Array();
	var i=Math.floor(Math.random()*6+10);
	for(var x=1 ; x <=i ; x++){
		var id=x;
		var name="stu"+x;
		var age = Math.floor(Math.random()*11+10);
		var sex = Math.floor(Math.random() * 2)>0? "男":"女"; 
		var score=parseInt(Math.random()*100) ;
		var stu = new Student(id,name,sex,age,score);
		studentArr.push(stu); 
		
	} 
// alert(stu.input(1));


  		var str = "";

        for (var i = 0; i <studentArr.length; i++) {	

            str +=	studentArr[i].input();

        }
        //弹出学生信息
        alert(str);        



	// function home(){
	// 	var key = prompt("请输入您需要的操作\n1.查看所有学生信息\n2.按年龄从小到大排序\n3.按成绩从大到小排序");
	// 	switch(key){
	// 		case "1":

	// 		break;
	// 		case "2":

	// 		break;
	// 		case "3":

	// 		break;
	// 		default:
	// 			alert("您的输入有误");
	// 	}
	// 	home();
	// }

	// home();
	



	</script>
</head>
<body>

</body>
</html>